<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JS基本语法</title>
</head>
<body>
    <script>
        var x;
        let y = 5;
        const PI = 3.14;
        console.log(x,y,PI);
        let name = "如花";
        console.log(name);
        let empty_value = null;
        console.log(empty_value);

        let age = 18;

        if(age > 18){
            console.log("你已经成年了");
        } else{
            console.log("未成年");
        }

        let time = 22;
        if(time < 12){
            alert('上午好');
        } else if(time < 18){
            alert('下午好');
        } else{
            alert('晚上好');
        }

        console.log('for 循环')
        for(let i = 1; i < 11; i++){
            console.log(i);
        }

        console.log("while 循环")
        let count = 1;
        while(count<11){
            console.log(count);
            count++;
        }

        console.log("循环关键词")
        for(var i = 0; i < 7; i++){
            if(i == 2){
                continue;
            }
            if(i == 4){
                break;
            }
            console.log(i)
        }
    </script>

</body>
</html>